﻿{include file="public/header"}
<title>订单录入</title>
</head>
<body>


<article class="page-container">
    <div class="ch-row ch-info-form">
        <div class="flex1">单位：</div>
        <div class="flex2">
            <input type="text" class="title form-control" name="title" value="{$data.title}">

            <input type="hidden" class="label_id" name="id" value="{$data.id}">
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">说明：</div>
        <div class="flex2">
            <input type="text" class="explain form-control" name="explain" value="{$data.explain}">

            <input type="hidden" class="label_id" name="id" value="{$data.id}">
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1">
            <button class="btn btn-primary radius" style="width: 100%;" type="button" ><i class="Hui-iconfont">&#xe632;</i> 提交</button>
        </div>
    </div>
</article>
{include file="public/footer"}
<script>
    $('.radius').click(function () {
        var title=$('.title').val();
        var id=$('.label_id').val();
        var explain=$('.explain').val();

        if(title==""){
            alert('请填写后提交');
        }else{
            var src="{:Url('index/channel/ed')}";
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data: {
                    title:title,
                    id:id,
                    explain:explain
                },
                success: function (data) {
                    var res=JSON.parse(data);
                    if(res.code==200){
                        layer.msg(res.msg, {icon: 1, time: 2000}, function (index,layero) {
                            parent.location.reload()
                        });
                    }else{
                        layer.msg(res.msg,{icon: 5,time:1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        }


    });
</script>
</body>
</html>